<?php
	include_once "baiviet_db.php";
	
	class baiviet_bs
	{
		//--------------Field---------------
			//1
		private $MaBaiViet = 0;
		public function SetMaBaiViet($MaBaiViet)             { $this->MaBaiViet = $MaBaiViet;                     }
		public function GetMaBaiViet()                       { return $this->MaBaiViet;                           }
			//2
		private $MaChuyenMuc = 0;
		public function SetMaChuyenMuc($MaChuyenMuc)         { $this->MaChuyenMuc = $MaChuyenMuc;                 }
		public function GetMaChuyenMuc()                     { return $this->MaChuyenMuc;                         }
			//3
		private $MaNguoiDung = 0;
		public function SetMaNguoiDung($MaNguoiDung)         { $this->MaNguoiDung = $MaNguoiDung;                 }
		public function GetMaNguoiDung()                     { return $this->MaNguoiDung;                         }
			//4
		private $TieuDe = "";
		public function SetTieuDe($TieuDe)                   { $this->TieuDe = $TieuDe;                           }
		public function GetTieuDe()                          { return $this->TieuDe;                              }
			//5
		private $NgayDang = "0000-00-00 00:00:00";
		public function SetNgayDang($NgayDang)               { $this->NgayDang = $NgayDang;                       }
		public function GetNgayDang()                        { return $this->NgayDang;                            }
			//6
		private $TomTat = "";
		public function SetTomTat($TomTat)                   { $this->TomTat = $TomTat;                           }
		public function GetTomTat()                          { return $this->TomTat;                              }
			//7
		private $NoiDung = "";
		public function SetNoiDung($NoiDung)                 { $this->NoiDung = $NoiDung;                         }
		public function GetNoiDung()                         { return $this->NoiDung;                             }
			//8
		private $HinhAnh = "";
		public function SetHinhAnh($HinhAnh)                 { $this->HinhAnh = $HinhAnh;                         }
		public function GetHinhAnh()                         { return $this->HinhAnh;                             }
			//9
		private $ChuThichHinhAnh = "";
		public function SetChuThichHinhAnh($ChuThichHinhAnh) { $this->ChuThichHinhAnh = $ChuThichHinhAnh;         }
		public function GetChuThichHinhAnh()                 { return $this->ChuThichHinhAnh;                     }
			//10
		private $MaTrangThai = -1;
		public function SetMaTrangThai($MaTrangThai)         { $this->MaTrangThai = $MaTrangThai;                 }
		public function GetMaTrangThai()                     { return $this->MaTrangThai;                         }
			//11
		private $LuotXem = 0;
		public function SetLuotXem($LuotXem)                 { $this->LuotXem = $LuotXem;                         }
		public function GetLuotXem()                         { return $this->LuotXem;                             }
			//12
		private $DuocChinhSua = -1;
		public function SetDuocChinhSua($DuocChinhSua)       { $this->DuocChinhSua = $DuocChinhSua;               }
		public function GetDuocChinhSua()                    { return $this->DuocChinhSua;                        }
			//13
		private $PIN = "";
		public function SetPIN($PIN)                         { $this->PIN = $PIN;                                 }
		public function GetPIN()                             { return $this->PIN;                                 }
			//14
		private $TuKhoa = "";
		public function SetTuKhoa($TuKhoa)                   { $this->TuKhoa = $TuKhoa;                           }
		public function GetTuKhoa()                          { return $this->TuKhoa;                              }
			//15
		private $ChoPhepBinhLuan = -1;
		public function SetChoPhepBinhLuan($ChoPhepBinhLuan) { $this->ChoPhepBinhLuan = $ChoPhepBinhLuan;         }
		public function GetChoPhepBinhLuan()                 { return $this->ChoPhepBinhLuan;                     }
		
		//--------------Method---------------
		public function Them()
		{
			$data = new baiviet_db();
			return $data->Them($this->MaBaiViet,
							   $this->MaChuyenMuc, 
							   $this->MaNguoiDung, 
							   $this->TieuDe,
							   $this->NgayDang, 
							   $this->TomTat, 
							   $this->NoiDung, 
							   $this->HinhAnh, 
							   $this->ChuThichHinhAnh, 
							   $this->MaTrangThai, 
							   $this->LuotXem, 
							   $this->DuocChinhSua, 
							   $this->PIN, 
							   $this->TuKhoa,
							   $this->ChoPhepBinhLuan);
		}
		
		public function CapNhat()
		{
			$data = new baiviet_db();
			return $data->CapNhat($this->MaBaiViet, $this->MaChuyenMuc, $this->MaNguoiDung, $this->TieuDe, 
								  $this->NgayDang, $this->TomTat, $this->NoiDung, $this->HinhAnh,
								  $this->ChuThichHinhAnh, $this->MaTrangThai,$this->LuotXem, 
								  $this->DuocChinhSua, $this->PIN, $this->TuKhoa);
		}
		public function CapNhatDuocChinhSua()
		{
			$data = new baiviet_db();
			return $data->CapNhatDuocChinhSua($this->MaBaiViet, $this->DuocChinhSua);
		}
		public function CapNhatTrangThai()
		{
			$data = new baiviet_db();
			return $data->CapNhatTrangThai($this->MaBaiViet, $this->MaTrangThai);
		}
		public function CapNhatPIN()
		{
			$data = new baiviet_db();
			return $data->CapNhatPIN($this->MaBaiViet, $this->PIN);
		}
		public function Xoa()
		{
			$data = new baiviet_db();
			return $data->Xoa($this->MaBaiViet);
		}
		
		public function LayDanhSach()
		{
			$data = new baiviet_db();
			return $data->LayDanhSach($this->MaBaiViet, $this->MaNguoiDung, $this->MaTrangThai);
		}
		
		public function Lay15BaiVietMoiNhat()
		{
			$data = new baiviet_db();
			return $data->Lay15BaiVietMoiNhat();
		}
		
		public function LayBaiVietTheoNgayGiamDan()
		{
			$data = new baiviet_db();
			return $data->LayBaiVietTheoNgayGiamDan($this->MaTrangThai);
		}
		public function LayBaiVietTheoLuotXemGiamDan()
		{
			$data = new baiviet_db();
			return $data->LayBaiVietTheoLuotXemGiamDan($this->MaTrangThai);
		}
		public function LayBaiVietTrongNgay()
		{
			$data = new baiviet_db();
			return $data->LayBaiVietTrongNgay($this->MaTrangThai);
		}
		public function LayBaiVietMoiNhatTheoChuDeBaiViet() //Tin liên quan
		{
			$data = new baiviet_db();
			return $data->LayBaiVietMoiNhatTheoChuDeBaiViet($this->MaBaiViet, $this->MaTrangThai);
		}
		public function DemSoBaiVietTheoMaNguoiDung()
		{
			$data = new baiviet_db();
			return $data->DemSoBaiVietTheoMaNguoiDung($this->MaNguoiDung);
		}
		
		public function LayBaiVietTheoChuDe($MaChuDe)
		{
			$data = new baiviet_db();
			return $data->LayBaiVietTheoChuDe($MaChuDe, $this->MaTrangThai);
		}
		
		public function TangMotLuotXem()
		{
			$data = new baiviet_db();
			return $data->TangMotLuotXem($this->MaBaiViet);
		}
		
		public function LayMaBaiVietLonNhat()
		{
			$data = new baiviet_db();
			return $data->LayMaBaiVietLonNhat();
		}
		
		public function LayTieuDeTheoMaBaiViet()
		{
			$data = new baiviet_db();
			return $data->LayTieuDeTheoMaBaiViet($this->MaBaiViet);
		}
		
		public function LayBaiVietPhanTrang($Start, $Limit)
		{
			$data = new baiviet_db();
			return $data->LayBaiVietPhanTrang($this->MaTrangThai, $this->MaNguoiDung, $Start, $Limit);
		}
		
		public function LayBaiVietTheoChuDePhanTrang($MaChuDe, $Start, $Limit)
		{
			$data = new baiviet_db();
			return $data->LayBaiVietTheoChuDePhanTrang($MaChuDe, $this->MaTrangThai, $Start, $Limit);
		}
		
		public function LayBaiVietTheoTuKhoa($TuKhoa)
		{
			$data = new baiviet_db();
			return $data->LayBaiVietTheoTuKhoa($this->MaTrangThai, $TuKhoa);
		}
		
		public function LayBaiVietTheoTuKhoaPhanTrang($TuKhoa, $Start, $Limit)
		{
			$data = new baiviet_db();
			return $data->LayBaiVietTheoTuKhoaPhanTrang($this->MaTrangThai, $TuKhoa, $Start, $Limit);
		}
		public function LayMaChuDeBaiViet()
		{
			$data = new baiviet_db();
			return $data->LayMaChuDeBaiViet($this->MaBaiViet);
		}
		public function DanhSachBaiVietTheoNguoiDung()
		{
			$data = new baiviet_db();
			return $data->DanhSachBaiVietTheoNguoiDung($this->MaNguoiDung);
		}
		
		public function IsTinChinh()
		{
			$data = new baiviet_db();
			return $data->IsTinChinh($this->MaBaiViet);
		}
		
		public function LayBaiVietTheoChuyenMuc()
		{
			$data = new baiviet_db();
			return $data->LayBaiVietTheoChuyenMuc($this->MaChuyenMuc, $this->MaTrangThai);
		}
		public function LayBaiVietTheoChuyenMucPhanTrang($Start, $Limit)
		{
			$data = new baiviet_db();
			return $data->LayBaiVietTheoChuyenMucPhanTrang($this->MaChuyenMuc, $this->MaTrangThai, $Start, $Limit);
		}
		public function TimKiem()
		{
			$data = new baiviet_db();
			return $data->TimKiem($this->TuKhoa);
		}
		public function KiemTraTonTai()
		{
			$data = new baiviet_db();
			return $data->KiemTraTonTai($this->MaBaiViet);
		}
		public function LayDanhSachTheoLuotThich()
		{
			$data = new baiviet_db();
			return $data->LayDanhSachTheoLuotThich();
		}
		public function LayDanhSachTheoLuotBinhLuan()
		{
			$data = new baiviet_db();
			return $data->LayDanhSachTheoLuotBinhLuan();
		}
	}
?>